package com.ls.utils;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ：xiangkeyu
 * @date ：Created in 2019/5/7 15:14
 * @description： 分页基础数据, 其他分页查询采用extends这个class
 * @modified By：
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class PagingQuery {
	
    @Builder.Default
    private Integer pageNum = 1;

    @Builder.Default
    private Integer pageSize = 10;

    @JsonIgnore
    @Builder.Default
    private Integer start = 0;


    /** 分页起始位置*/
    public Integer getStart(){
        return (this.getPageNum() - 1) * this.getPageSize();
    }
    /** 分页大小*/
    public Integer getEnd(){
        return this.getPageSize();
    }
}
